package com.zheng.service.serviceImpl;

import com.zheng.mapper.BooksMapper;
import com.zheng.pojo.Books;
import com.zheng.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class BookServiceImpl implements BookService {

    @Autowired
    BooksMapper booksMapper;
   //查询书籍
    @Override
    public List<Books> queryBookList(Map<String,Integer> map) {
        return booksMapper.queryBookList(map) ;
    }

    //查询所有的图书
    @Override
    public List<Books> findAllCount() {
        return booksMapper.findAllCount();
    }

    //查询总数
    @Override
    public Long findTotals() {
        return booksMapper.findTotals();
    }

    //增加书籍的信息
    @Override
    public int addBook(Books books) {
        return booksMapper.addBook(books);
    }


    //查询某一本书籍
    @Override
    public Books findBookById(int bookId) {
        return booksMapper.findBookById(bookId);
    }

    //修改书籍信息
    @Override
    public int updateBook(Books books) {
        return booksMapper.updateBook(books);
    }

    //删除某一个书籍
    @Override
    public int deleteBook(int bookId) {
        return booksMapper.deleteBook(bookId);
    }
}
